package com.hsw.t3;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.Period;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) throws ParseException {
//        Scanner sc = new Scanner(System.in);
//        String s = sc.next();
//        String p = "yyyy年MM月dd日";
//        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(p);
//        Date d1 = simpleDateFormat.parse(s);
//        System.out.println(d1);
//        long time0 = d1.getTime();
//        System.out.println(time0);
//        Date now = new Date();
//        long time = now.getTime();
//        System.out.println(time);
//        //拿到两者的时间毫秒差值
//        long l = time - time0;
//        //将差值转为日期
//        long numOfDay = l / 1000 / 3600 / 24;
//        System.out.println(numOfDay);
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日");
        LocalDate ld = LocalDate.parse("2000年10月10日", dateTimeFormatter);
        System.out.println("====");
        System.out.println(ld);
        LocalDateTime now1 = LocalDateTime.now();
        System.out.println(now1);
//        Duration between = Duration.between(ld, now1);
//        long days = between.toDays();
//        System.out.println(days);
    }
}
